/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.services.finance;

/**
 *
 * @author jay
 */

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.faces.model.SelectItem;
import src.domain.finance.Bv;
import src.services.CRUEDService;

public class BvModel implements java.io.Serializable {
    
    private CRUEDService service;
    
    public BvModel() {
        service = new CRUEDService();
    }
    
    public List<Bv> findAll(Map<String, String> filters) {
        return (List<Bv>) service.findAll("Bank", filters);
    }

    public List<SelectItem> listAll() {
        return service.listAll("Bv", "bvId", "bvNo");
    }
    
    public Bv getByAccount(String value) {
        Map<String, String> where = new HashMap<>();
        where.put("bv.bvNo", value);
        return (Bv) service.getObjectSQL("from Bv bv", where);
    }
    
    public boolean saveData(Bv data) {
        return service.saveData(data);
    }
    
    public boolean deleteData(Bv data) {
        return service.deleteData(data);
    }
}
